weixianzuoyeguanliView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        weixianzuoyeguanliView.superclass.constructor.call(this, {
            id : "weixianzuoyeguanliView",
            title : "危险作业管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
         var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'WeiXianZuoYeGuanLiForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "作业编号"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_zuoYeBianHao_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "危险作业列表",
                rowActions:true,
                listUrl : __ctxPath + "/weixianzuoye/listWeiXianZuoYeGuanLi.do",
                removeUrl : __ctxPath + "/weixianzuoye/deleteWeiXianZuoYeGuanLi.do",
                fields : [ "id", 'years','institution','zuoYeBianHao', "zuoYeMingCheng", "zuoYeBuMen", "zuoYeLeiXing","weiXianDengJi","zuoYeFuZeRen"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                },  {
                    header : "作业编号",
                    dataIndex : "zuoYeBianHao",
                    width : 100
                }, {
                    header : "作业名称",
                    dataIndex : "zuoYeMingCheng",
                    width : 70
                }, {
                    header : "作业部门",
                    dataIndex : "zuoYeBuMen",
                    width : 70
                }, {
                    header : "作业类型",
                    dataIndex : "zuoYeLeiXing",
                    width : 100
                },{
                    header:"危险等级",
                    dataIndex:"weiXianDengJi",
                    width:100
                },{
                    header:"作业负责人",
                    dataIndex:"zuoYeFuZeRen",
                    width:100
                },{
                    header : "评估信息",
                    dataIndex : "id",
                    sortable : false,
                    width : 50,
                    renderer : function(j, i, g, m, h) {
                        var cfg={
                                weixianzuoyeId : g.data.id,
                                zuoyebianhao : g.data.zuoYeBianHao,
                                zuoyemingcheng : g.data.zuoYeMingCheng
                        }
                        console.info()
                        var k = "";
                                k += '<button title="评估" value="" class="btn-showDetail" onclick=\'weixianzuoyeguanliView.pingGuXinXi('
                                    + JSON.stringify(cfg) + ')\'></button>';
                        return k;
                    }
                }],
                
            },
            tree : {
                treeUrl : __ctxPath + "/weixianzuoye/treeLoadWeiXianZuoYeGuanLi.do"
            }
            
        });
        return yearGridComponents;
    }
});
weixianzuoyeguanliView.pingGuXinXi=function(weixianzuoye){
    new weixianzuoyepingguWindow({
        weixianzuoyeId : weixianzuoye.weixianzuoyeId,
        zuoyebianhao: weixianzuoye.zuoyebianhao,
        zuoyemingcheng: weixianzuoye.zuoyemingcheng
        }).show();
}